from django.db import models
class Device_list(models.Model):
    device_name=models.CharField(max_length=32)
    device_mac=models.CharField(max_length=32)
    device_pubilicid=models.CharField(max_length=32,null=True)

class Device_data(models.Model):
    year=models.IntegerField()
    month = models.IntegerField()
    day=models.IntegerField()
    hour=models.IntegerField()
    minute=models.IntegerField()
    second=models.IntegerField()
    data=models.CharField(max_length=255)
    ug=models.ForeignKey('Device_list',on_delete=models.CASCADE)


class Satellites(models.Model):
    year=models.IntegerField()
    month = models.IntegerField()
    day=models.IntegerField()
    hour=models.IntegerField()
    minute=models.IntegerField()
    second=models.IntegerField()
    num=models.IntegerField()
    response=models.CharField(max_length=512,null=True)
    ug=models.ForeignKey('Device_list',on_delete=models.CASCADE)


class UserAdmin(models.Model):
    username=models.CharField(max_length=32)
    password=models.CharField(max_length=32)
    permissions=models.CharField(max_length=10)


class temComp(models.Model):
    tem=models.CharField(max_length=32)
    count=models.IntegerField()
    time=models.CharField(max_length=32)
    device_mac = models.CharField(max_length=32)


class ElectricDeviceList(models.Model):
    deviceNum=models.CharField(max_length=32)
    deviceMac=models.CharField(max_length=32)


class ElectricDeviceData(models.Model):
    one1=models.FloatField()
    one2=models.FloatField()
    one3=models.FloatField()
    one4=models.FloatField()
    one5=models.FloatField()
    two1=models.FloatField()
    two2=models.FloatField()
    two3=models.FloatField()
    two4=models.FloatField()
    two5=models.FloatField()
    three1=models.FloatField()
    three2=models.FloatField()
    three3=models.FloatField()
    three4=models.FloatField()
    three5=models.FloatField()
    four1=models.FloatField()
    four2=models.FloatField()
    four3=models.FloatField()
    four4=models.FloatField()
    four5=models.FloatField()
    four6=models.FloatField()
    four7=models.FloatField()
    four8=models.FloatField()
    four9=models.FloatField()
    five1=models.FloatField()
    five2=models.FloatField()
    five3=models.FloatField()
    five4=models.FloatField()
    five5=models.FloatField()
    five6=models.FloatField()
    time=models.IntegerField()
    ug = models.ForeignKey('ElectricDeviceList', on_delete=models.CASCADE)

class DailyElectcons(models.Model):
    econs=models.FloatField()
    date=models.CharField(max_length=32)
    ug=models.ForeignKey('ElectricDeviceList', on_delete=models.CASCADE)